Skip to content

FIX handle converter preview path inspection errors - #2427

Open
Roman Lutz (romanlutz) wants to merge 2 commits into
microsoft:mainfrom
romanlutz:romanlutz-converter-base64-handling
Open

FIX handle converter preview path inspection errors#2427
Roman Lutz (romanlutz) wants to merge 2 commits into
microsoft:mainfrom
romanlutz:romanlutz-converter-base64-handling

Conversation

@romanlutz

Copy link
Copy Markdown
Contributor

Description

Converter previews inspect *_path media values to distinguish existing local files from raw base64. Some runtime and filesystem combinations can raise OSError or ValueError while inspecting long or invalid path-like values, causing preview serialization to fail before the media is persisted.

Treat only those filesystem inspection failures as a non-path result and continue through the existing raw base64 persistence path. Existing local files, URLs, and data URIs retain their current behavior, while serializer and converter errors still propagate.

Tests and Documentation

  • Added coverage for long raw base64 media and response serialization.
  • Added deterministic coverage for OSError and ValueError path inspection failures.
  • Added coverage that invalid base64 errors still propagate and existing local files remain unchanged.
  • Ran targeted backend tests: 120 passed, 4 skipped.
  • Ran Ruff check and format check on the changed files.
  • Documentation and JupyText: N/A.

Treat filesystem inspection failures as raw media data while preserving serializer errors and existing local file paths.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@hannahwestra25 hannahwestra25 self-assigned this Aug 19, 2026
Comment thread pyrit/backend/services/converter_service.py
Only classify path inspection failures as raw media when the value is syntactically valid base64.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: fc71346a-510b-4b93-a031-1e810452dcb0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants